package com.ctrip.demo.java8;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class CollectionsTest {
    static List<String> list = new ArrayList<String>();

    static {
        list.add("1");
        list.add("2");
        list.add("3");
        list.add("4");
        list.add("5");
        list.add("6");
        list.add("7");
        list.add("8");
    }

    public static void main(String[] args) {
        shuffle();
    }



    public static void shuffle() {
        Collections.shuffle(list);
        Collections.shuffle(list, new Random(100));

        list.stream().forEach(s ->System.out.println(s));
    }
}


